home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 41.zip
/
BS1 part 41
/
Lattice C v5.02 d4.adf
/
examples
/
debugger
/
dbptr.cpr
< prev
next >
Wrap
Text File
|
1988-11-07
|
1KB
|
41 lines
/*
DBPTR -- Dump memory as bytes for a given BPTR
(1 byte hex values with text)
DBPTR (<variable> | <address> | <range>)
>dbptr var /* Dumps 64 bytes pointed to by BPTR var */
>dbptr var l 10 /* Dumps 10 bytes pointed to by BPTR var */
>dbptr 0x82034 /* Dumps 64 bytes from location 0x002080d0 */
>dbptr 0x82034 l 5 /* Dumps 5 bytes from location 0x002080d0 */
Note that a BPTR is an address shifted right 2.
*/
parse arg expr ' l ' len ' L ' len2
if (expr = '?') then
do
do i = 2 to 9
'd "' strip(sourceline(i),'T', "0a"x) '"'
end
exit(0)
end
options failat 3
options results
'd ' expr
stat = rc
val = strip(result,'T',"0a"x)
options
if (stat ~= 0) then
do
'd "Error: can''t find' expr '"'
exit(0)
end
val = strip(val)
if (~datatype(val,'x')) then
do
'd " ^------------should be an ''address''"'
exit(0)
end
lenspec = ''
if (len ~= '') then lenspec = 'l' len
if (len2 ~= '') then lenspec = 'L' len2
'db 0x'|| c2x(d2c(c2d(x2c(val))*4,4)) lenspec
exit(0)